"""

This script formats model data so it can easily be read into R.

The default output is three spaces between columns, which doesn't work for an R delimiter. So we replace them with tabs.

"""

import sys

def main():
	
	inputFilePath = sys.argv[1]
	outputFilePath = sys.argv[2]

	inputFileHandle = open(inputFilePath, 'r')
	outputFileHandle = open(outputFilePath, 'w')

	for line in inputFileHandle:
		fields = line.strip().split('   ')
		outputFileHandle.write('\t'.join(fields)+'\n')

	inputFileHandle.close()
	outputFileHandle.close()

main()
